cmake_minimum_required(VERSION 3.16.0)

set(project_name "cuda_fly")

option(CUDA_ENABLE "enable cuda or not" ON)
option(OPENCL_ENABLE "enable opencl or not" ON)

project(${project_name})

enable_language(CUDA)

set(PROJECT_HOME ${CMAKE_CURRENT_SOURCE_DIR})
# 设置第三方路径的变量
set(CUDA_HOME /usr/local/cuda)
set(CUDA_TARGETS "targets/x86_64-linux")
set(CUDA_INCLUDE_DIR ${CUDA_HOME}/${CUDA_TARGETS}/include)
set(CUDA_LIB_DIR ${CUDA_HOME}/${CUDA_TARGETS}/lib)

set(GFLAGS_HOME "${PROJECT_HOME}/lib/gflags-dev")
set(GFLAGS_INCLUDE_DIR "${GFLAGS_HOME}/include")
set(GFLAGS_LIB_DIR "${GFLAGS_HOME}/lib")

set(YAML_CPP_HOME "${PROJECT_HOME}/lib/yaml-cpp-dev")
set(YAML_CPP_INCLUDE_DIR "${YAML_CPP_HOME}/include")
set(YAML_CPP_LIB_DIR "${YAML_CPP_HOME}/lib")

set(GOOGLETEST_HOME "${PROJECT_HOME}/lib/googletest-dev")
set(GOOGLETEST_INCLUDE_DIR "${GOOGLETEST_HOME}/include")
set(GOOGLETEST_LIB_DIR "${GOOGLETEST_HOME}/lib")

include_directories(${CUDA_INCLUDE_DIR}
    ${PROJECT_HOME}/include
    ${GFLAGS_INCLUDE_DIR}
    ${YAML_CPP_INCLUDE_DIR}
    ${GOOGLETEST_INCLUDE_DIR}
)

message(STATUS "${CUDA_HOME}/${CUDA_TARGETS}/include")

add_subdirectory(${PROJECT_HOME}/src)
